<h2 id="search_header">Search Classes</h2>
<% form_tag({:action=> "search"}, { :onSubmit => "Element.show('spinner');", :id => 'search_form' }) do %>
	<table>
		<tr><td>School:	</td><td><%= select_tag 'search_department', options_for_select([['All', 'all']]+Department.find(:all).collect { |e| [e.name, e.id.to_s] }) %>	</td></tr>
		<tr><td>Name:	</td><td><%= text_field_tag 'search_course_title' %>			</td></tr>
	</table>
	<%= check_box_tag 'electives', 'technical' %>Just Technical Electives<br>
	<div class="tiny" id="show_hide_extra" onclick="new Effect.toggle('extra_fields', 'blind')">- extra fields -</div>
	<div id="extra_fields" style="display: none">
	<br>Number:<%= text_field_tag 'search_number' %>
	<br>Instructor:
		<%= select_tag 'search_instructor', options_for_select([['All', 'all']]+Instructor.find(:all).collect { |e| [e.name, e.id.to_s] }) %>
	<br><fieldset id="days">
	<legend>Days(inclusive)</legend>
		<%= check_box_tag 'day', 'monday' %>Monday<br>
		<%= check_box_tag 'day', 'tuesday' %>Tuesday<br>
		<%= check_box_tag 'day', 'wednesday' %>Wednesday<br>
		<%= check_box_tag 'day', 'thursday' %>Thursday<br>
		<%= check_box_tag 'day', 'friday' %>Friday<br>
	</fieldset>
	<br><fieldset id="time">
	<legend>Time</legend>
		<br>After:<%= text_field_tag 'time_after' %>
			<%= select_tag 'after_time_am_pm', options_for_select([['AM', 'am'], ['PM', 'pm']]) %>
		<br>Before:<%= text_field_tag 'time_before' %>
			<%= select_tag 'after_time_am_pm', options_for_select([['AM', 'am'], ['PM', 'pm']]) %>
	</fieldset>
	</div>
<% end %>


<div id="search_results">
	<div id="results_header">Search Results <img src="images/spinner.gif" id="spinner" style="display:none"></div>
	<div id="search_results_courses" class="searched_courses courses">
		
	</div>
</div>

<%= observe_form('search_form',
                 :frequency => 0.5,
                 :update => :search_results_courses,
                 :loading => "Element.show('spinner')",
                 :complete => "Element.hide('spinner')",
                 :url => { :action => :live_search }) %>